#include "triangletest.h"
#include "triangle.h"

void TriangleTest::initTestCase()
{
    //init
}

void TriangleTest::case1_type()
{
    //取出测试数据
    QFETCH(Triangle, triangle);
    QFETCH(QString, result);
    //测试
    QCOMPARE(triangle.getType(), result);
}

void TriangleTest::case1_type_data()
{
    //添加列
    QTest::addColumn<Triangle>("triangle");
    QTest::addColumn<QString>("result");

    //输入测试数据
    QTest::newRow("test1")<<Triangle(1,1,1)<<"等边三角形";
    QTest::newRow("test2")<<Triangle(2,2,1)<<"等腰三角形";
    QTest::newRow("test3")<<Triangle(3,4,5)<<"普通三角形";

}
